package com.haiertvbic.tvnow.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.haiertvbic.tvnow.R;
import com.haiertvbic.tvnow.model.Actor;

public class ActorsAdapter extends BaseAdapter {
	private ArrayList<Actor> actors;
	private Context context;

	public ActorsAdapter(ArrayList<Actor> strs, Context context) {
		this.actors = strs;
		this.context = context;
	}

	@Override
	public int getCount() {
		return actors.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		TextView childName;
		if (convertView == null) {
			convertView = View.inflate(context, R.layout.layout_program_group,
					null);
			childName = (TextView) convertView.findViewById(R.id.group_name);
			convertView.setTag(childName);
		} else {
			childName = (TextView) convertView.getTag();
		}
		childName.setText(actors.get(position).getStarName());
		return convertView;
	}

}
